﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.Basic.Infratrucate
{
    public class BaseRepositroy<T>: IBaseRepositroy<T> where T : class
    {
        private readonly DataDBContext db;
        public BaseRepositroy(DataDBContext db)
        {
            this.db= db;
        }

        public IQueryable<T> GetAll()
        {
            return db.Set<T>().AsQueryable();
        }
        public int Add(T entity)
        {
            db.Set<T>().Add(entity);
            return db.SaveChanges();
        }
    }
}
